//
//  JOTabBarController.m
//  网易彩票
//
//  Created by song on 15/2/7.
//  Copyright (c) 2015年 song. All rights reserved.
//

#import "JOTabBarController.h"
#import "JOTabBar.h"

@interface JOTabBarController ()

@property(nonatomic,weak) UIButton *selectedButton;
@end

@implementation JOTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    
    JOTabBar *tabbar  =[[JOTabBar alloc]init];
    tabbar.delegate = self;
    tabbar.frame  = self.tabBar.bounds;
    [self.tabBar addSubview:tabbar];
//    tabbar.backgroundColor =[UIColor redColor];

    for (int i =0 ; i< self.viewControllers.count; i++) {
        NSString *name = [NSString stringWithFormat:@"TabBar%d",i+1];
        NSString *selname = [NSString stringWithFormat:@"TabBar%dSel",i+1];
        [tabbar addTabButtonWithName:name selName:selname];
        
    }
    
   
    
}

//-(UIStatusBarStyle)preferredStatusBarStyle
//{
//    return UIStatusBarStyleLightContent;
//}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)tabBar:(JOTabBar *)tabBar didSelectItemFrom:(int)from to:(int)to
{
    self.selectedIndex = to;
}


@end
